import java.util.HashMap;
import java.util.LinkedList;

public class DepthFirstSearchTest {
    public static void main(String[] args) {
        Graph graph = new Graph(13);
        graph.addEdge(0,5);
        graph.addEdge(0,1);
        graph.addEdge(0,2);
        graph.addEdge(0,6);
        graph.addEdge(5,3);
        graph.addEdge(5,4);
        graph.addEdge(3,4);
        graph.addEdge(4,6);
        graph.addEdge(7,8);
        graph.addEdge(9,11);
        graph.addEdge(9,12);
        graph.addEdge(9,10);
        graph.addEdge(11,12);



        // 获取边的数量
        System.out.println(graph.getEdge());
        // 获取顶点数量
        System.out.println(graph.getApexNum());
        // 获取和顶点 0 相邻的所有顶点
        LinkedList<Integer> adj = graph.adj(0);
        for (Integer integer : adj) {
            System.out.println("0 ——> "+integer);
        }
        System.out.println("==================");
        // 对图进行深搜
        DepthFirstSearch depthFirstSearch = new DepthFirstSearch(graph,0);
        // 判断w顶点于 0 起点点是否相通
        System.out.println(depthFirstSearch.marked(5));
        System.out.println(depthFirstSearch.marked(3));
        System.out.println(depthFirstSearch.marked(7));
        //  获取与顶点 apex 相通的所有顶点的总数
        System.out.println(depthFirstSearch.getCount());
    }
}
